#include "thread.h"
#include "thread_list.h"
#include <assert.h>
#include <stdio.h>

void thread_exit(void *retval){

  current_thread->status=0;
  current_thread->ret=retval;
  //printf("thread %d exité:\n",current_thread->id);
  //print_thread_list(list_thread);
  
  remove_thread(list_thread, current_thread);
  //printf("après avoir supprimé:\n");
  
  //print_thread_list(list_thread);
  thread_yield();

}
